﻿/*****************************************************************//**
 * @file   VAOneXMLAdaptorMaterial.h
 * @brief  VAOne读写适配器材料
 * 
 * @author TanDongYang
 * @date   2024-10-16
 *********************************************************************/
#ifndef VAONEXMLADAPTORMATERIAL_H
#define VAONEXMLADAPTORMATERIAL_H

#include "FITKVAOneXMLIOAPI.h"
#include "FITKAbstractVAOneXMLAdaptor.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"


namespace Acoustics
{
    class FITKAcousticsMaterialManager;
}

namespace IO
{
    /**
     * @brief   VAOne读写适配器材料
     * @author  TanDongYang (tandongyang@diso.cn)
     * @date    2024-10-16
     */
    class FITKVAOneXMLIOAPI VAOneXMLAdaptorMaterial : public FITKAbstractVAOneXMLAdaptor
    {
        FITKCLASS(IO, VAOneXMLAdaptorMaterial);
    public:

        /**
         * @brief   Construct a new VAOneXMLAdaptorMaterial object
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-10-16
         */
        explicit VAOneXMLAdaptorMaterial()= default;
        /**
         * @brief   Destroy the VAOneXMLAdaptorMaterial object
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-10-16
         */
        ~VAOneXMLAdaptorMaterial() = default;
        /**
         * @brief   适配器读数据
         * @return  是否执行成功
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-10-22
         */
        bool adaptR() override;
        /**
         * @brief   适配器写数据（待调整）
         * @return  是否执行成功
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-10-22
         */
        bool adaptW() override;

    private:
        /**
         * @brief   读取流体材料数据
         * @return  是否执行成功
         * @author  XingXuanCi (xingxuanci@diso.cn)
         * @date    2024-10-22
         */
        bool readMaterialFluid();
        /**
         * @brief   写流体材料数据
         * @return  是否执行成功
         * @author  XingXuanCi (xingxuanci@diso.cn)
         * @date    2024-10-22
         */
        bool writeMaterialFluid();
        /**
         * @brief   读取泡沫材料数据
         * @return  是否执行成功
         * @author  XingXuanCi (xingxuanci@diso.cn)
         * @date    2024-10-22
         */
        bool readMaterialFoam();
        /**
         * @brief   写泡沫材料数据
         * @return  是否执行成功
         * @author  XingXuanCi (xingxuanci@diso.cn)
         * @date    2024-10-22
         */
        bool writeMaterialFoam();
        /**
         * @brief   读取纤维材料数据
         * @return  是否执行成功
         * @author  XingXuanCi (xingxuanci@diso.cn)
         * @date    2024-10-22
         */
        bool readMaterialFiber();
        /**
         * @brief   写纤维材料数据
         * @return  是否执行成功
         * @author  XingXuanCi (xingxuanci@diso.cn)
         * @date    2024-10-22
         */
        bool writeMaterialFiber();
        /**
         * @brief   读取各向同性固体材料数据
         * @return  是否执行成功
         * @author  XingXuanCi (xingxuanci@diso.cn)
         * @date    2024-10-22
         */
        bool readMaterialIsosolid();
        /**
         * @brief   写各向同性固体材料数据
         * @return  是否执行成功
         * @author  XingXuanCi (xingxuanci@diso.cn)
         * @date    2024-10-22
         */
        bool writeMaterialIsosolid();
        /**
         * @brief   读取粘弹性材料数据
         * @return  是否执行成功
         * @author  XingXuanCi (xingxuanci@diso.cn)
         * @date    2024-10-22
         */
        bool readMaterialViscoElasticMaterial();
        /**
         * @brief   写粘弹性材料数据
         * @return  是否执行成功
         * @author  XingXuanCi (xingxuanci@diso.cn)
         * @date    2024-10-22
         */
        bool writeMaterialViscoElasticMaterial();
        /**
         * @brief   声学材料管理器
         * @author  XingXuanCi (xingxuanci@diso.cn)
         * @date    2024-11-09
         */
        Acoustics::FITKAcousticsMaterialManager* _materialsManager{};

    };
    Register2FITKIOAdaptorFactory(VAOneXML, Acoustics::FITKAcousticsMaterialManager, VAOneXMLAdaptorMaterial)
}

#endif // VAONEXMLADAPTORMATERIAL_H
